import http from "@/api/index";

// 全部角色
export const getRoleAll = () => {
  return http.get(`/role/all`);
};

// 角色列表
export const getRoleList = data => {
  return http.get(`/role/list`, data);
};

// 添加角色
export const addRole = data => {
  return http.post(`/role/add`, data);
};

// 更新角色
export const editRole = data => {
  return http.post(`/role/update`, data);
};

// 删除角色
export const delRole = ids => {
  return http.post(`/role/delete`, ids);
};

// 角色详情
export const detailRole = id => {
  return http.get<BaseResponse<Role>>(`/role/detail?id=${id}`);
};

export interface Role {
  id?: number;
  role_name?: string;
  role_code?: string;
  role_desc?: string;
  menu_ids: number[];
  status: number;
}
